﻿<%@ Page Language="C#" MasterPageFile="~/Template.master" AutoEventWireup="true"
    CodeFile="SearchStock.aspx.cs" Inherits="SearchStock" Title="Untitled Page" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<script language="javascript" type="text/javascript">
</script>
<div class="title">
        <span class="pageTitle">جستجو کالا</span>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    </div>
    
    <div><hr id="HR1" onclick="return HR1_onclick()" />
        <table width="100%">
            <tr>
                <td colspan="3">
        <table width="80%">
            <tr>
                <td>
                    <asp:Label ID="Label1" runat="server" Text="نام کالا"></asp:Label></td>
                <td>
                    <asp:TextBox ID="txtName" runat="server" MaxLength="50"></asp:TextBox>
                    </td>
                <td>
                    <asp:Label ID="Label6" runat="server" Text="وضعیت"></asp:Label></td>
                <td>
                    <asp:DropDownList ID="ddlStatus" runat="server" Width="191px" OnDataBound="ddlStatus_DataBound">
                        <asp:ListItem Selected="True" Value="0">---</asp:ListItem>
                    </asp:DropDownList>&nbsp;</td>
            </tr>
            <tr>
                <td style="width: 94px">
                    <asp:Label ID="Label3" runat="server" Text="شماره سریال"></asp:Label></td>
                <td>
                    <asp:TextBox ID="txtSerial" runat="server"></asp:TextBox></td>
                <td>
                    <asp:Label ID="Label2" runat="server" Text="شماره سطل"></asp:Label></td>
                <td>
                    <asp:TextBox ID="txtBinNumber" runat="server"></asp:TextBox>&nbsp;</td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label4" runat="server" Text="تاریخ ورود کالا"></asp:Label></td>
                <td>
                    <ajaxtoolkit:maskededitextender id="meeStartDate" runat="server" acceptnegative="Left"
                        culturename="fa-IR" mask="9999/99/99" masktype="None" messagevalidatortip="true"
                        onfocuscssclass="MaskedEditFocus" oninvalidcssclass="MaskedEditError" targetcontrolid="txtImportDate"></ajaxtoolkit:maskededitextender>
                    <asp:TextBox ID="txtImportDate" runat="server" Style="direction: ltr; text-align: left"
                        Width="141px"></asp:TextBox></td>
                <td>
                    </td>
                <td>
                    <asp:Button ID="btnSearch" runat="server" Text="جستجو" OnClick="btnSearch_Click1" ValidationGroup="SaveStock" /></td>
            </tr>
        </table>
                    <asp:Label ID="lblMsg" runat="server" Text="موردی یافت نشد "></asp:Label></td>
            </tr>
            <tr>
                <td colspan="3">
                    <asp:GridView ID="grdStock" runat="server" AutoGenerateColumns="False" DataKeyNames="ID" OnRowCommand="grdStock_RowCommand">
                        <Columns>
                            <asp:BoundField DataField="ID" HeaderText="کد" />
                            <asp:BoundField DataField="StockName" HeaderText="نام کالا" />
                            <asp:BoundField DataField="BinNumber" HeaderText="شماره سطل" />
                            <asp:BoundField DataField="Serial" HeaderText="سریال" 
                                ConvertEmptyStringToNull="False" NullDisplayText="---" />
                            <asp:BoundField DataField="Quantity" HeaderText="تعداد" />
                            <asp:BoundField DataField="OrderPoint" HeaderText="نقطه سفارش" />
                            <asp:TemplateField HeaderText="تاریخ ایجاد">
                                <ItemTemplate>
                                   <%# Mani.Common.MyPersianDate.DateTimeToPersian(Eval("ImportDate")) %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="Description" HeaderText="توضیحات" 
                                ConvertEmptyStringToNull="False" NullDisplayText="---" />
                            <asp:CommandField SelectText="خروج کالا" ShowSelectButton="True" />
                        </Columns>
                    </asp:GridView>
                    <ajaxToolkit:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="server"
                        TargetControlID="pnlGoods"  CollapseControlID = "chkRealseGoods" 
                        ExpandDirection ="Vertical"  Enabled = "true" 
                        ExpandControlID ="chkRealseGoods" Collapsed = "true">
                        
                    </ajaxToolkit:CollapsiblePanelExtender>
                </td>
            </tr>
            <tr>
                <td colspan="3" style="height: 22px">

                    <asp:CheckBox ID="chkRealseGoods" runat="server" Text="خروج کالا از انبار" AutoPostBack="True" /></td>
            </tr>
            <tr>
                <td colspan="3">
                    <asp:Label ID="Label12" runat="server" Text="کد کالا"></asp:Label>
                    <asp:Label ID="lblGoodID" runat="server" BackColor="White" Text="-"></asp:Label></td>
            </tr>
            <tr>
                <td colspan="3" style="height: 21px">
                    <asp:Label ID="Label13" runat="server" Text="تعداد موجود در انبار"></asp:Label>
                    <asp:Label ID="lblGoodsCount" runat="server" BackColor="White" Text="-"></asp:Label></td>
            </tr>
            <tr>
                <td colspan="3">
                    <asp:Panel ID="pnlGoods" runat="server" GroupingText="اطلاعات خروج کالا ">
                        <table width="80%">
                            <tr>
                                <td>
                                    <asp:Label ID="Label8" runat="server" Text="نام کالا"></asp:Label></td>
                                <td style="width: 201px">
                                    <asp:TextBox ID="txtRGoodName" runat="server" MaxLength="50" ReadOnly="True" Width="139px"></asp:TextBox></td>
                                <td>
                                    <asp:Label ID="Label9" runat="server" Text="شماره سریال" Width="94px"></asp:Label></td>
                                <td>
                                    <asp:TextBox ID="txtRGoodSerial" runat="server" Width="116px" ReadOnly="True"></asp:TextBox></td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="Label11" runat="server" Text="تحویل گیرنده"></asp:Label></td>
                                <td>
                                    <asp:TextBox ID="txtEmpId" runat="server" Width="140px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtEmpId"
                                        ErrorMessage="*" ValidationGroup="Goods"></asp:RequiredFieldValidator>
                                    <asp:Button ID="Button1" runat="server" Text="...." /></td>
                                <td>
                                    <asp:Label ID="Label10" runat="server" Text="شماره سطل"></asp:Label></td>
                                <td colspan="1">
                                    <asp:TextBox ID="txtRGoodBinNo" runat="server" ReadOnly="True" Width="116px"></asp:TextBox></td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="Label14" runat="server" Text="توضیحات"></asp:Label></td>
                                <td >
                                    <asp:TextBox ID="txtRGoodDesc" runat="server" Width="192px" TextMode="MultiLine"></asp:TextBox></td>
                                <td>
                                    <asp:Label ID="Label15" runat="server" Text="وضعیت"></asp:Label></td>
                                <td colspan="1">
                                    <asp:DropDownList ID="ddlStockStatus" runat="server" Width="129px">
                                    </asp:DropDownList></td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="Label5" runat="server" Text="مورد استفاده" Width="88px"></asp:Label></td>
                                <td >
                                    <asp:TextBox ID="txtRGoodUsage" runat="server"
                                        Width="192px" AutoCompleteType="Search"></asp:TextBox></td>
                                <td>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtRGoodUsage"
                                        ErrorMessage="**" ValidationGroup="Goods"></asp:RequiredFieldValidator></td>
                                <td colspan="1" style="width: 125px">
                                    <asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="ذخیره" ValidationGroup="Goods" /></td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:CheckBox ID="chkUsageList" runat="server" Text="انتخاب از لیست" 
                                        oncheckedchanged="chkUsageList_CheckedChanged" />
                                </td>
                                <td>
                                    <asp:ListBox ID="lstUsageDesc" runat="server" Enabled ="false"></asp:ListBox>
                                </td>
                                <td>
                                    &nbsp;</td>
                                <td colspan="1" style="width: 125px">
                                    &nbsp;</td>
                            </tr>
                        </table>
                        </asp:Panel>
                </td>
            </tr>
            <tr>
                <td>
                    <div>
                        </div>
                        <asp:Label ID="lblSaveMsg" runat="server" Text="کالا با موفقیت تخصیص داده شد" Visible="False"></asp:Label>
                        <asp:Label ID="lblSaveErrorMsg" runat="server" ForeColor="Red" Text="امکان خروج این کالا موجود نمی باشد"
                            Visible="False"></asp:Label></td>
                    
            </tr>
        </table>
        <br />
    </div>
    
    <div>
        &nbsp;</div>
</asp:Content>